export default ({ http }) => ({
  /**
   * @description 获取版块
   */
  getExamModuleList(response) {
    return http.get(`/exam/module/list`, {}, response)
  },
  /**
   * @description 知识点分类列表
   * @param {Object} data 携带的信息
   */
  getExamPointCategory(data, response) {
    return http.get(`/exam/point/list`, data, response)
  },
  /**
   * @description 知识点选择-返回知识点练习题基础信息
   * @param {Object} data 携带的信息
   */
  getExamPointPracticeBasic(data, response) {
    return http.get(`/exam/point/prictice/basic`, data, response)
  },
  /**
   * @description 获取试题
   * @param {Object} data 携带的信息
   * @param {Number} topic_id 试题的id
   * @param {Number} origin 试题的类型【1：知识点；2：专项；3：考试；4：套卷；5错题；6：收藏；】
   */
  getExamTopic(data, response) {
    return http.get(`/exam/topic`, data, response)
  },
  /**
   * @description 知识点-提交试题答案
   * @param {Object} data 携带的信息
   * @param {Number} topic_level 试题层级【1：大题；2：小题】
   * @param {Number} topic_id 试题的id
   * @param {Number} is_right 答案是否正确【0：否 1：是】
   */
  getExamPointPricticeTopic(data, response) {
    return http.post(`/exam/point/prictice/topic`, data, response, {}, false)
  },
  /**
   * @description 收藏和取消收藏题试题
   * @param {Object} data 携带的信息
   * @param {Number} topic_id 试题的id
   * @param {Number} status 答案是否正确【0：取消收藏；1：收藏；】
   */
  postExamTopicCollect(data, response) {
    return http.post(`/exam/topic/collect`, data, response, {}, false)
  },
  /**
   * @description 收藏列表
   * @param {Object} data 携带的信息
   */
  getExamTopicCollectList(data, response) {
    return http.get(`/exam/topic/collect/list`, data, response)
  },
  /**
   * @description 获取专项列表
   * @param {Object} data 携带的信息
   * @param {Number} module_id 版块ID
   */
  getExamSpecialList(data, response) {
    return http.get(`/exam/special/list`, data, response)
  },
  /**
   * @description 获取专项试题基础信息
   * @param {Object} data 携带的信息
   * @param {Number} special_id 专项ID，可以是第一级，也可以是任意子集
   */
  getExamSpecialBase(data, response) {
    return http.get(`/exam/special/base`, data, response)
  },
  /**
   * @description 专项练习-专项试题答案提交
   * @param {Object} data 携带的信息
   * @param {Number} topic_level 试题层级【1：大题；2：小题】
   * @param {Number} topic_id 试题的id
   * @param {Number} is_right 答案是否正确【0：否 1：是】
   */
  postExamSpecialTopic(data, response) {
    return http.post(`/exam/special/topic`, data, response, {}, false)
  },
  /**
   * @description 专项练习-重新答题清空记录
   * @param {Object} data 携带的信息
   * @param {Number} special_id 专项ID，对应每一级的专项ID
   */
  deleteExamSpecialRecord(data, response) {
    return http.delete(`/exam/special/record`, data, response, {}, false)
  },
  /**
   * @description 专项练习-搜索
   * @param {Object} data 携带的信息
   */
  getExamSpecialSearch(data, response) {
    return http.get(`/exam/special/search`, data, response)
  },
  /**
   * @description 公开考试-考试列表
   * @param {Object} data 携带的信息
   * @param {Number} module_id 版块ID
   * @param {Number} category 试卷分类ID
   */
  getExamPaperList(data, response) {
    return http.get(`/exam/paper/list`, data, response)
  },
  /**
   * @description 公开考试-获取试题
   * @param {Object} data 携带的信息
   * @param {Number} paper_id
   * @param {Number} topic_id
   */
  getExamPaperTopic(data, response) {
    return http.get(`/exam/paper/topic`, data, response)
  },
  /**
   * @description 公开考试-考试分类
   * @param {Object} data 携带的信息
   * @param {Number} module_id 版块ID
   */
  getExamPaperCategory(data, response) {
    return http.get(`/exam/paper/category`, data, response)
  },
  /**
   * @description 公开考试-获取考试基础信息
   * @param {Object} data 携带的信息
   * @param {Number} paper_id ID
   */
  getExamPaperBase(data, response) {
    return http.get(`/exam/paper/base`, data, response)
  },
  /**
   * @description 公开考试-答案提交
   * @param {Object} data 携带的信息
   */
  postExamPaperAnswer(data, response, error) {
    return http.post(`/exam/paper/answer`, data, response, error, false)
  },
  /**
   * @description 套卷练习-列表
   * @param {Object} data 携带的信息
   */
  getExamRollupList(data, response) {
    return http.get(`/exam/rollup/list`, data, response)
  },
  /**
   * @description 套卷练习-获取试题
   * @param {Object} data 携带的信息
   */
  getExamRollupPaperTopic(data, response) {
    return http.get(`/exam/rollup/paper/topic`, data, response)
  },
  /**
   * @description 套卷练习-套卷详情
   * @param {Object} data 携带的信息
   * @param {Number} module_id 版块ID
   */
  getExamRollupDetail(data, response) {
    return http.get(`/exam/rollup/detail`, data, response)
  },
  /**
   * @description 套卷练习-获取试卷基础信息
   * @param {Object} data 携带的信息
   * @param {Number} rollup_id ID
   * @param {Number} paper_id ID
   */
  getExamRollupPaperBase(data, response) {
    return http.get(`/exam/rollup/paper/base`, data, response)
  },
  /**
   * @description 套卷练习-交卷
   * @param {Object} data 携带的信息
   * @param {Number} rollup_id ID
   * @param {Number} paper_id ID
   */
  postExamRollupPaperAnswer(data, response, error) {
    return http.post(`/exam/rollup/paper/answer`, data, response, error, false)
  },
  /**
   * @description 错题本-列表
   */
  getExamTopicWrongList(data, response) {
    return http.get(`/exam/topic/wrong/list`, data, response)
  },
  /**
   * @description 错题本-获取试题
   * @param {Number} rollup_id 错题记录ID，默认为0，返回错题本第一题
   */
  getExamTopicWrong(data, response) {
    return http.get(`/exam/topic/wrong`, data, response)
  },
  /**
   * @description 错题本-答案提交
   * @param {Number} topic_level 试题层级【1：大题；2：小题】
   * @param {Number} topic_id 试题的id
   * @param {Number} is_right 答案是否正确【0：否 1：是】
   */
  postExamTopicWrong(data, response) {
    return http.post(`/exam/topic/wrong`, data, response, {}, false)
  },
  /**
   * @description 阅卷-待/已批阅试卷列表
   * @param {String} type 【uncorrected：待批阅；corrected：已批阅；】
   */
  getExamPaperMarking(type, data, response) {
    return http.get(`/exam/paper/${type}`, data, response)
  },
  /**
   * @description 阅卷-试卷用户列表
   * @param {Number} status 【1：待批阅；2：已批阅；】
   * @param {Number} paper_id 试卷ID
   */
  getExamPaperUsers(data, response) {
    return http.get(`/exam/paper/users`, data, response)
  },
  /**
   * @description 阅卷-阅卷渲染
   * @param {Number} record_id 试卷用户列表record_id字段
   * @param {Number} paper_id 试卷ID
   */
  getExamPaperUserFetch(data, response) {
    return http.get(`/exam/paper/user/fetch`, data, response)
  },
  /**
   * @description 阅卷-阅卷提交
   * @param {Number} record_id 试卷用户列表record_id字段
   * @param {Object} data 答案
   */
  postExamPaperUser(data, response) {
    return http.post(`/exam/paper/user`, data, response, {}, false)
  },
  /**
   * @description 一级分类
   * @param {Number} query Query参数
   * @param {Function} response 成功回调
   */
  getExamCategoryTop(response, error) {
    return http.get(`/exam/category/top`, {}, response, error)
  },
  /**
   * @description 分类树
   * @param {Number} query Query参数
   * @param {Function} response 成功回调
   */
  getExamCategoryTree(query, response, error) {
    return http.get(`/exam/category/second/tree`, query, response, error)
  },
  
  /**
   * @description 分类树
   * @param {Number} query Query参数
   * @param {Function} response 成功回调
   */
  getExamAnswerRecord(query, response, error) {
    return http.get(`/exam/answer/record`, query, response, error)
  }
})



